﻿CREATE TABLE [dbo].[Fields] (
    [FieldID]    INT            IDENTITY (1, 1) NOT NULL,
    [FieldName]  NVARCHAR (MAX) NULL,
    [FieldType]  NVARCHAR (MAX) NULL,
    [FieldInfo]  NVARCHAR (MAX) NULL,
    [WorkflowID] INT            NOT NULL,
    CONSTRAINT [PK_dbo.Fields] PRIMARY KEY CLUSTERED ([FieldID] ASC),
    CONSTRAINT [FK_dbo.Fields_dbo.Workflows_WorkflowID] FOREIGN KEY ([WorkflowID]) REFERENCES [dbo].[Workflows] ([WorkflowID])
);


GO
CREATE NONCLUSTERED INDEX [IX_WorkflowID]
    ON [dbo].[Fields]([WorkflowID] ASC);

